﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace HobSoft.SoccerBet2014.Domain.DataService
{
    using Core;
    using Models;
    using Models.Site;
    /// <summary>
    /// 管理博彩公司网站的具体业务请求
    /// </summary>
    public interface IBetSiteManagerService : IService
    {
        Encoding Encoding { get; set; }
        string Account { get; }
        byte BookerID { get; }
        string GlobalHost { get; }
        string Host { get; }

        bool IsInitialize { get; }

        ILoginInfo LoginInfo { get; }
        LoginState LoginState { get; }

        void Initialize(string globalHost, byte bookerId, string account);
        void RecoverContext();
        bool ValidSessionOnline(DateTime lastUpdate);

        Task<bool> Start();
        Task RequestSignupToken();
        Task ChangeLauguage();
        Task<bool> Signout();
        Task<bool> Signup(string password);
        Task<bool> Signup(string password, string token);
        Task<string> RequestMainPage();
        Task<IList<Game>> RequestEarlyMarketOdds();
        Task<IList<Game>> RequestLiveFullOdds();
        Task<IList<Game>> RequestTodayFullOdds();
        Task<bool> RequestUpdateLiveOdds();
        Task<bool> RequestUpdateTodayOdds();

        Task<BetTick> RequestTick(BetTick oldTick);
        Task<BetTick> RequestTick(string oddsId, OddsPrice price);

        Task<BettingResult> RequestBetting(BetTick tick, decimal money);

        Task<bool> CheckSession();
        Task StartHeartbeat();

    }
}
